package com.zxd.streams;

import java.util.Objects;

/**
 * ClassName:StreamStudent
 * Package:com.zxd.streams
 *
 * @Date:2023/9/24 21:53
 * @Author:zxde
 */
public class StreamStudent {
    private String name;
    private int age;
    private double height;

    public StreamStudent(String name, Integer age, Double height) {
        this.name = name;
        this.age = age;
        this.height = height;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public double getHeight() {
        return height;
    }

    public void setHeight(Double height) {
        this.height = height;
    }

    @Override
    public String toString() {
        return "StreamStudent{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", height=" + height +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        StreamStudent that = (StreamStudent) o;
        return age == that.age && Double.compare(that.height, height) == 0 && Objects.equals(name, that.name);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, age, height);
    }
}
